<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:f="http://xmlns.jcp.org/jsf/core">

    <ui:composition template="/template.xhtml">
        <ui:define name="title">
            <h:outputText value="#{bundle.CreateEventTitle}"></h:outputText>
        </ui:define>
        <ui:define name="body">
            <h:panelGroup id="messagePanel" layout="block">
                <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
            </h:panelGroup>
            <h:form>
                <h:panelGrid columns="2">
                    <h:outputLabel value="#{bundle.CreateEventLabel_eventID}" for="eventID" />
                    <h:inputText id="eventID" value="#{eventController.selected.eventID}" title="#{bundle.CreateEventTitle_eventID}" required="true" requiredMessage="#{bundle.CreateEventRequiredMessage_eventID}"/>
                    <h:outputLabel value="#{bundle.CreateEventLabel_eventName}" for="eventName" />
                    <h:inputText id="eventName" value="#{eventController.selected.eventName}" title="#{bundle.CreateEventTitle_eventName}" />
                    <h:outputLabel value="#{bundle.CreateEventLabel_eventDesciption}" for="eventDesciption" />
                    <h:inputText id="eventDesciption" value="#{eventController.selected.eventDesciption}" title="#{bundle.CreateEventTitle_eventDesciption}" />
                    <h:outputLabel value="#{bundle.CreateEventLabel_eventDate}" for="eventDate" />
                    <h:inputText id="eventDate" value="#{eventController.selected.eventDate}" title="#{bundle.CreateEventTitle_eventDate}" >
                        <f:convertDateTime pattern="MM/dd/yyyy" />
                    </h:inputText>
                    <h:outputLabel value="#{bundle.CreateEventLabel_eventStartTime}" for="eventStartTime" />
                    <h:inputText id="eventStartTime" value="#{eventController.selected.eventStartTime}" title="#{bundle.CreateEventTitle_eventStartTime}" >
                        <f:convertDateTime pattern="HH:mm:ss" />
                    </h:inputText>
                    <h:outputLabel value="#{bundle.CreateEventLabel_eventEndTime}" for="eventEndTime" />
                    <h:inputText id="eventEndTime" value="#{eventController.selected.eventEndTime}" title="#{bundle.CreateEventTitle_eventEndTime}" >
                        <f:convertDateTime pattern="HH:mm:ss" />
                    </h:inputText>
                    <h:outputLabel value="#{bundle.CreateEventLabel_eventCity}" for="eventCity" />
                    <h:inputText id="eventCity" value="#{eventController.selected.eventCity}" title="#{bundle.CreateEventTitle_eventCity}" />
                    <h:outputLabel value="#{bundle.CreateEventLabel_eventIndoorOutdoor}" for="eventIndoorOutdoor" />
                    <h:inputText id="eventIndoorOutdoor" value="#{eventController.selected.eventIndoorOutdoor}" title="#{bundle.CreateEventTitle_eventIndoorOutdoor}" />
                    <h:outputLabel value="#{bundle.CreateEventLabel_eventPublicPrivate}" for="eventPublicPrivate" />
                    <h:inputText id="eventPublicPrivate" value="#{eventController.selected.eventPublicPrivate}" title="#{bundle.CreateEventTitle_eventPublicPrivate}" />
                    <h:outputLabel value="#{bundle.CreateEventLabel_eventNotification}" for="eventNotification" />
                    <h:inputText id="eventNotification" value="#{eventController.selected.eventNotification}" title="#{bundle.CreateEventTitle_eventNotification}" />
                    <h:outputLabel value="#{bundle.CreateEventLabel_userEmail}" for="userEmail" />
                    <h:selectOneMenu id="userEmail" value="#{eventController.selected.userEmail}" title="#{bundle.CreateEventTitle_userEmail}" required="true" requiredMessage="#{bundle.CreateEventRequiredMessage_userEmail}">
                        <f:selectItems value="#{userController.itemsAvailableSelectOne}"/>
                    </h:selectOneMenu>
                </h:panelGrid>
                <br />
                <h:commandLink action="#{eventController.create}" value="#{bundle.CreateEventSaveLink}" />
                <br />
                <br />
                <h:commandLink action="#{eventController.prepareList}" value="#{bundle.CreateEventShowAllLink}" immediate="true"/>
                <br />
                <br />
                <h:link outcome="/index" value="#{bundle.CreateEventIndexLink}"/>
            </h:form>
        </ui:define>
    </ui:composition>

</html>
